function validate_required(field,alerttxt) {
	with (field) {
		if (value==null||value=="")  {
			alert(alerttxt);return false;
		} else {
			return true;
		}
	}
}
function verifypeople(thisform) {
   	with (thisform) {	
		if(surname.value == "Last Name") {
			alert("Please enter a surname. It is a required field.");
			surname.focus();return false;
		} else if (validate_required(surname,"Surname is a required field.") == false) {
			surname.focus();return false;
		}
		if(firstname.value == "First Name") {
			firstname.value = "";
		}
	}
}
function verifyprofessional(thisform) {
    with (thisform) {
        if (firstname.value == "First Name" || firstname.value == "Your First Name") {
            alert("Please enter a first name. It is a required field.");
            firstname.focus(); return false;
        } else if (validate_required(firstname, "First name is a required field.") == false) {
            firstname.focus(); return false;
        }
    
        if (surname.value == "Last Name" || surname.value == "Your Last Name") {
            alert("Please enter a surname. It is a required field.");
            surname.focus(); return false;
        } else if (validate_required(surname, "Surname is a required field.") == false) {
            surname.focus(); return false;
        }

        if (country.value == "not") {
            alert("Please select a country. It is a required field.");
            country.focus(); return false;
        }  
    }
}

function verifypublication(thisform) {
	with (thisform) {	
		if(publication.value == "Publication") {
			alert("Please enter the fields marked required.");
			publication.focus();return false;
		}
		if(from.value == "From - dd/mm/yyyy") {
			alert("Please enter the fields marked required.");
			from.focus();return false;
		} 
		if(to.value == "To - dd/mm/yyyy") {
			alert("Please enter the fields marked required.");
			to.focus();return false;
		} 

	}
}
function resetText(thisinput) {
	if(thisinput.value == "") {
	    if (thisinput.name == "firstname") {
	        thisinput.value = "First Name";
	    } else if (thisinput.name == "surname") {
	        thisinput.value = "Last Name";
	    } else if (thisinput.name == "from") {
	        thisinput.value = "From - dd/mm/yyyy";
	    } else if (thisinput.name == "to") {
	        thisinput.value = "To - dd/mm/yyyy";
	    } else if (thisinput.name == "citytown") {
	        thisinput.value = "Town";
	    }		
	}
}
function removeText(thisinput) {
    if ((thisinput.value == "First Name" || thisinput.value == "Your First Name") && thisinput.name == "firstname") {
	 thisinput.value = "";
    }
    if ((thisinput.value == "Last Name" || thisinput.value == "Your Last Name") && thisinput.name == "surname") {
         thisinput.value = "";
    }    
    if (thisinput.value == "Town" && thisinput.name == "citytown") {
         thisinput.value = "";
    }
    if (thisinput.value == "From - dd/mm/yyyy" && thisinput.name == "from") {
         thisinput.value = "";
    }
    if (thisinput.value == "To - dd/mm/yyyy" && thisinput.name == "to") {
         thisinput.value = "";
    } 	   
}